package com.distributeredis.redis_springboot.springapachehttpclienthttpconnectionresttemplate.httpclient.study3.controller;

import com.distributeredis.redis_springboot.springapachehttpclienthttpconnectionresttemplate.httpclient.study3.vo.UserEmployee;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserEmployController {


    @GetMapping("/testGet")
    public UserEmployee test1(UserEmployee employee) {
        System.out.println(employee);
        return new UserEmployee("a","b","c");
    }

    @PostMapping("/testPost")
    public List<UserEmployee> test2(UserEmployee employee) {
        System.out.println(employee);
        return Arrays.asList(new UserEmployee("a","b","c"));
    }

    @PostMapping("/testPost1")
    public List<UserEmployee> test3(@RequestBody UserEmployee employee) {
        System.out.println(employee);
        return Arrays.asList(new UserEmployee("a","b","c"));
    }

    @PostMapping("/testPost2")
    public List<UserEmployee> test4(@RequestBody List<UserEmployee> employee) {
        System.out.println(employee);
        return Arrays.asList(new UserEmployee("x","y","z"));
    }

}
